package cn.edu.zafu.bigdata.zqt.StudentGradeManager;

import java.util.HashMap;
import java.util.Map;

public class StudentGradeManager {
    private Map<String, Integer> grades;
    public StudentGradeManager() {
        grades = new HashMap<>();
    }
    public void addStudent(String name, int grade) {
        grades.put(name, grade);
    }
    public int getGrade(String name) {
        return grades.getOrDefault(name,-1);
    }
    public void removeStudent(String name) {
        grades.remove(name);
    }
    public static void main(String[] args) {
        StudentGradeManager manager = new StudentGradeManager();
        manager.addStudent("Alice", 90);
        manager.addStudent("Bob", 85);
        manager.addStudent("Charlie", 95);
        System.out.println(manager.getGrade("Alice"));
        System.out.println(manager.getGrade("Bob")); 
        System.out.println(manager.getGrade("Charlie"));
        manager.removeStudent("Bob");
        System.out.println(manager.getGrade("Bob"));
    }
}
